<template>
  <div>
      <template v-for="(leftmenu,index) in leftMenu">
        <template v-if="leftmenu.c_name===storeMenuCurrent">
          <Menu ref="side_menu" theme="light" width="auto" :open-names="leftOpenName" :active-name="leftActive"
                @on-select="showSubmenu" @on-open-change="showSubOpenmenu" :key="index">
            <div v-for="(list1,Pindex) in leftmenu.children" :key="Pindex">
              <Submenu v-if="list1.children&&list1.children.length!==0" :name="list1.c_name">
                <template slot="title">
                  <span class="mar_r5 iconfont fon_14 color_6" :class="list1.icon"></span>
                  <span>{{ list1.nav_name }}</span>
                </template>
                <menu-item :name="list2.c_name" v-for="list2 in list1.children" :to="list2.c_name"
                           :key="list2.id" @click.native="updateNumber(list2.hot)">
                          <span
                              v-if="list2.hot==null || !list2.hot || list2.hot=='0' ||orderNumber==0">{{ list2.nav_name }}</span>
                  <el-badge v-else :value="orderNumber" class="item">
                    <span>{{ list2.nav_name }}</span>
                  </el-badge>
                </menu-item>
              </Submenu>
              <MenuItem class="noChildmenuitem" v-else :name="list1.c_name" :to="list1.c_name">
                <span class="mar_r5 iconfont fon_14 color_6" :class="list1.icon"></span>
                {{ list1.nav_name }}
              </MenuItem>
            </div>
          </Menu>
        </template>
      </template>
      <Menu :active-name="leftActive" theme="light" width="auto" ref="side_menu" :open-names="leftOpenName"
            v-if="menuCurrent==13" @on-select="showSubmenu" @on-open-change="showSubOpenmenu">
        <MenuItem name="1">
          <Icon type="ios-navigate"></Icon>
          账号管理
        </MenuItem>
      </Menu>
  </div>
</template>
<script>
import {mapState} from "vuex";

export default {
  name: 'LeftNav',
  props: {
    leftActive: {},
    leftMenu: {},
    leftOpenName: {},
    menuCurrent: {},
    orderNumber: {},
    showSubOpenmenu: {},
    showSubmenu: {},

  },
  computed: {
    ...mapState(['updataOrder', 'storeMenuCurrent', 'nav'])
  },
  methods:{
    updateNumber(status) {
      if (status) this.getWaitReceiv();
    },
  }
}
</script>
<style lang="scss">

.leftLayout {
  width: 100%;
  overflow-x: hidden;
  border-right: 1px solid #dcdee2;
}



.i-layout-header-logo img {
  height: 80%;
  vertical-align: middle;
}



</style>